package git.soulbgm.common.injector;

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import com.baomidou.mybatisplus.extension.injector.methods.Upsert;
import git.soulbgm.common.mapper.UpsertList;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Phoenix注入器
 *
 * @author SoulBGM
 * @date 2022/05/06 23:54
 */
@Component
public class PhoenixInjector extends DefaultSqlInjector {

    @Override
    public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) {
        List<AbstractMethod> methodList = super.getMethodList(mapperClass, tableInfo);
        methodList.add(new Upsert());
        methodList.add(new UpsertList());
        return methodList;
    }

}
